package com.house.twohouse.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.house.common.utils.PageUtils;
import com.house.common.utils.Query;

import com.house.twohouse.dao.HouseingDao;
import com.house.twohouse.entity.HouseingEntity;
import com.house.twohouse.service.HouseingService;


@Service("houseingService")
public class HouseingServiceImpl extends ServiceImpl<HouseingDao, HouseingEntity> implements HouseingService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        //模糊查询
        QueryWrapper<HouseingEntity> w = new QueryWrapper<>();
        String name = (String) params.get("name");
        if (StringUtils.isNotEmpty(name)){
            w.like("houseing_name",name);
        }
        IPage<HouseingEntity> page = this.page(
                new Query<HouseingEntity>().getPage(params),
                w
        );

        return new PageUtils(page);
    }

}